Optimal. Leaf size=46 \[ \frac {b \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}-\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}+\frac {b \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {6037, 269, 218,
212, 209} \begin {gather*} -\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}+\frac {b \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}+\frac {b \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 212
Rule 218
Rule 269
Rule 6037
Rubi steps
\begin {align*} \int \frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x^2} \, dx &=-\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}-(2 b c) \int \frac {1}{\left (1-\frac {c^2}{x^4}\right ) x^4} \, dx\\ &=-\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}-(2 b c) \int \frac {1}{-c^2+x^4} \, dx\\ &=-\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}+b \int \frac {1}{c-x^2} \, dx+b \int \frac {1}{c+x^2} \, dx\\ &=\frac {b \tan ^{-1}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}-\frac {a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}+\frac {b \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 72, normalized size = 1.57 \begin {gather*} -\frac {a}{x}+\frac {b \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}-\frac {b \tanh ^{-1}\left (\frac {c}{x^2}\right )}{x}-\frac {b \log \left (\sqrt {c}-x\right )}{2 \sqrt {c}}+\frac {b \log \left (\sqrt {c}+x\right )}{2 \sqrt {c}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 47, normalized size = 1.02
method | result | size |
derivativedivides | \(-\frac {a}{x}-\frac {b \arctanh \left (\frac {c}{x^{2}}\right )}{x}-\frac {b \arctan \left (\frac {\sqrt {c}}{x}\right )}{\sqrt {c}}+\frac {b \arctanh \left (\frac {\sqrt {c}}{x}\right )}{\sqrt {c}}\) | \(47\) |
default | \(-\frac {a}{x}-\frac {b \arctanh \left (\frac {c}{x^{2}}\right )}{x}-\frac {b \arctan \left (\frac {\sqrt {c}}{x}\right )}{\sqrt {c}}+\frac {b \arctanh \left (\frac {\sqrt {c}}{x}\right )}{\sqrt {c}}\) | \(47\) |
risch | \(-\frac {b \ln \left (x^{2}+c \right )}{2 x}-\frac {-i \pi b c \,\mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}+i \pi b c \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )-i \pi b c \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}+2 i \pi b c \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}-2 i \pi b c -i \pi b c \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{3}+i \pi b c \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}-i \pi b c \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{3}+i \pi b c \,\mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}-i \pi b c \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )-2 \sqrt {-c}\, b \ln \left (c -x \sqrt {-c}\right ) x +2 \sqrt {-c}\, b \ln \left (-x \sqrt {-c}-c \right ) x -2 \sqrt {c}\, b \ln \left (-\sqrt {c}-x \right ) x +2 \sqrt {c}\, b \ln \left (-x +\sqrt {c}\right ) x -2 \ln \left (-x^{2}+c \right ) b c +4 a c}{4 c x}\) | \(373\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.46, size = 57, normalized size = 1.24 \begin {gather*} \frac {1}{2} \, {\left (c {\left (\frac {2 \, \arctan \left (\frac {x}{\sqrt {c}}\right )}{c^{\frac {3}{2}}} - \frac {\log \left (\frac {x - \sqrt {c}}{x + \sqrt {c}}\right )}{c^{\frac {3}{2}}}\right )} - \frac {2 \, \operatorname {artanh}\left (\frac {c}{x^{2}}\right )}{x}\right )} b - \frac {a}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] Leaf count of result is larger than twice the leaf count of optimal. 84 vs.
\(2 (38) = 76\).
time = 0.37, size = 159, normalized size = 3.46 \begin {gather*} \left [\frac {2 \, b \sqrt {c} x \arctan \left (\frac {x}{\sqrt {c}}\right ) + b \sqrt {c} x \log \left (\frac {x^{2} + 2 \, \sqrt {c} x + c}{x^{2} - c}\right ) - b c \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) - 2 \, a c}{2 \, c x}, -\frac {2 \, b \sqrt {-c} x \arctan \left (\frac {\sqrt {-c} x}{c}\right ) + b \sqrt {-c} x \log \left (\frac {x^{2} - 2 \, \sqrt {-c} x - c}{x^{2} + c}\right ) + b c \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + 2 \, a c}{2 \, c x}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 886 vs.
\(2 (42) = 84\).
time = 3.66, size = 886, normalized size = 19.26 \begin {gather*} \begin {cases} - \frac {a}{x} & \text {for}\: c = 0 \\- \frac {a - \infty b}{x} & \text {for}\: c = - x^{2} \\- \frac {a + \infty b}{x} & \text {for}\: c = x^{2} \\\frac {2 a c^{\frac {7}{2}} \sqrt {- c}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {2 a c^{\frac {3}{2}} x^{4} \sqrt {- c}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {b c^{\frac {7}{2}} x \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {b c^{\frac {7}{2}} x \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {2 b c^{\frac {7}{2}} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {b c^{\frac {3}{2}} x^{5} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {b c^{\frac {3}{2}} x^{5} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {2 b c^{\frac {3}{2}} x^{4} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {2 b c^{3} x \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {b c^{3} x \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {b c^{3} x \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {2 b c^{3} x \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {2 b c x^{5} \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {b c x^{5} \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} + \frac {b c x^{5} \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} - \frac {2 b c x^{5} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{\frac {7}{2}} x \sqrt {- c} + 2 c^{\frac {3}{2}} x^{5} \sqrt {- c}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 62, normalized size = 1.35 \begin {gather*} -b c {\left (\frac {\arctan \left (\frac {x}{\sqrt {-c}}\right )}{\sqrt {-c} c} - \frac {\arctan \left (\frac {x}{\sqrt {c}}\right )}{c^{\frac {3}{2}}}\right )} - \frac {b \log \left (\frac {x^{2} + c}{x^{2} - c}\right )}{2 \, x} - \frac {a}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.96, size = 59, normalized size = 1.28 \begin {gather*} \frac {b\,\mathrm {atan}\left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}-\frac {a}{x}-\frac {b\,\ln \left (x^2+c\right )}{2\,x}+\frac {b\,\ln \left (x^2-c\right )}{2\,x}-\frac {b\,\mathrm {atan}\left (\frac {x\,1{}\mathrm {i}}{\sqrt {c}}\right )\,1{}\mathrm {i}}{\sqrt {c}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________